package acwing.数学.质数;

import java.util.Scanner;

/**
 * 试除法判定质数
 *
 * @author yang
 * @date 2022/1/15
 */
public class 试除法判定质数 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int m = sc.nextInt();
        while (m-- > 0) {
            int n = sc.nextInt();
            boolean f = isCheck(n);
            if (f) System.out.println("Yes");
            else System.out.println("No");
        }

    }

    private static boolean isCheck(int n) {

        for (int i = 2; i <= n / i; i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

}
